package models;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;

import play.db.ebean.Model;

@Entity
public class Etat extends Model {

	@Id
	public Long id_etat;
	public String libelle_etat;

	public static Finder<Long, Etat> find = new Finder<Long, Etat>(Long.class,
			Etat.class);

	public static Etat findById(Long id) {
		return find.where().eq("id_etat", id).findUnique();
	}

	public String getLibelle_etat() {
		return libelle_etat;
	}

	public static List<Etat> listeEtats() {
		return find.where().findList();
	}

	public static Etat getEtatById(Long id) {
		return Etat.find.ref(id);

	}

}
